/*
 * Copyright Notice ====================================================
 * This file contains proprietary information of Hewlett-Packard Co.
 * Copying or reproduction without prior written approval is prohibited.
 * Copyright (c) 2013 All rights reserved. =============================
 */

package com.hp.ecs.xqa.vo;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.ManyToOne;

import com.hp.ecs.xqa.util.orm.Idable;

@Entity
public class Violation implements Idable {
	private static final String PARAS = "?display_title=true&amp;metric=88&amp;period=3&amp;rule=";

	public static final String PRE_FIX = "resource/index/";

	@Id
	private Long id;

	private String file;

	@Column(length = 20000)
	private String content;

	private int status;

	private String owner;

	private int count;

	private String level;

	@ManyToOne
	private Sonar sonar;

	public String getParas() {
		return PARAS + getLevel();
	}

	public String getContentUrl() {
		return PRE_FIX + getFile() + getParas()+"&amp;layout=false&amp;popup=true";
	}

	public Sonar getSonar() {
		return sonar;
	}

	public void setSonar(Sonar sonar) {
		this.sonar = sonar;
	}

	public int getCount() {
		return count;
	}

	public String getLevel() {
		return level;
	}

	public void setLevel(String level) {
		this.level = level;
	}

	public void setCount(int count) {
		this.count = count;
	}

	public Long getId() {
		return id;
	}

	public String getFile() {
		return file;
	}

	public String getContent() {
		return content;
	}

	public int getStatus() {
		return status;
	}

	public String getOwner() {
		return owner;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public void setFile(String file) {
		this.file = file;
	}

	public void setContent(String content) {
		this.content = content;
	}

	public void setStatus(int status) {
		this.status = status;
	}

	public void setOwner(String owner) {
		this.owner = owner;
	}
}
